<%-- 
    Document   : JspEmployConsult
    Created on : Aug 9, 2013, 1:43:20 PM
    Author     : Administrator
--%>


<%@include file="../head/JspHeadMainMenu.jsp" %>

<%@page import="com.mx.im.sinocab.bean.Employ"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%
    String ContextPath = request.getContextPath();
    List<Employ> listaEmpleados = (List) request.getAttribute("listaEmpleados");
    Employ empleado = request.getAttribute("unEmpleado") != null ? (Employ) request.getAttribute("unEmpleado") : null;
%>
<html> 
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
        <title>Consultar Empleado</title>


        <script type="text/javascript">
            function consultarEmpleado(idEmploy) {
                document.formEmpleado.action = "<%=contextPath%>/EmployConsult?idEmploy=" + idEmploy + "&tipoOperacion=consultar";
                document.formEmpleado.submit();
            }
        </script>
    </head>

    <body>

        <form id="formEmpleado" name="formEmpleado" method="post" > 

            <br>

            <fieldset style="width:200px;" align="center" >
                <table width="1100" border="0">
                    <tr>
                        <td width="563">&nbsp;</td>
                        <td width="204" style=" color: white">Favor de Seleccionar un empleado de la siguiente lista: </td>
                        <td width="319">&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><select id="slcEmpleados" name="slcEmpleados"  onChange="consultarEmpleado(this.value);">
                                <option value="-1">Seleccione un Empleado</option>
                                <%for (Employ unEmpleado : listaEmpleados) {%>
                                <option value="<%=unEmpleado.getIdEmploy()%>"><%=unEmpleado.getName()%>  <%=unEmpleado.getLastName() %></option>
                                <%}%>
                            </select></td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </fieldset>
            <%if (empleado != null) {%>
            <fieldset style="margin:auto">
                <table  width="750" border="1" align="center" id="table" >
                    <tr>
                        <th width="102" align="center">ID</th>
                        <th width="52" align="center">Nombre</th>
                        <th width="80" align="center">Apellidos</th>
                        <th width="82" align="center">Telefono</th>
                        <th width="82" align="center">Celular</th>
                        <th width="82" align="center">Direccion</th>
                        <th width="82" align="center">Genero</th>
                        <th width="82" align="center">F.Nacimiento</th>
                        <th width="82" align="center">Edad</th>
                        <th width="100" align="center">E-mail</th>
                        <th width="110" align="center">F.Admision</th>
                        <th width="82" align="center">D.Economicos</th>
                        <th width="82" align="center">Tipo Trabajador</th>
                        <th width="82" align="center">E.Civil</th>
                        <th width="82" align="center">G.Estudios</th>
                        <th width="82" align="center">Modificar</th>
                        <th width="82" align="center">Eliminar</th>

                    </tr>

                    <tr>

                        <td><center>
                                <input type="hidden" name="idEmploy"  value="<%=empleado.getIdEmploy()%>"  id="idEmploy"/>
                                <label> <%=empleado.getIdEmploy()%>  </label>
                            </center></td>
                        <td align="center">
                            <input type="hidden" name="name" value="<%=empleado.getName()%>" id="name"/>
                            <label> <%=empleado.getName()%>  </label>
                        </td> 

                        <td align="center" >
                            <input type="hidden" name="lastName" value="<%=empleado.getLastName()%>"id="lastName"/>
                            <%=empleado.getLastName()%>
                        </td>

                        <td align="center" >
                            <input type="hidden" name="phone" value="<%=empleado.getPhone()%>"id="phone"/>
                            <%=empleado.getPhone()%>
                        </td>
                        <td align="center" >
                            <input type="hidden" name="cellphone" value="<%=empleado.getCellphone()%>"id="cellphone"/>
                            <%=empleado.getCellphone()%>
                        </td>

                        <td align="center" >
                            <input type="hidden" name="address" value="<%=empleado.getAddress()%>"id="address"/>
                            <%=empleado.getAddress()%>
                        </td>
                        <td align="center" >
                            <input type="hidden" name="gender" value="<%=empleado.getGender()%>"id="gender"/>
                            <%=empleado.getGender()%>
                        </td>

                        <td align="center" >
                            <input type="hidden" name="birthday" value="<%=empleado.getBirthday()%>"id="birthday"/>
                            <%=empleado.getBirthday()%>
                        </td>
                        <td align="center" >
                            <input type="hidden" name="age" value="<%=empleado.getAge()%>"id="age"/>
                            <%=empleado.getAge()%>
                        </td>

                        <td align="center" >
                            <input type="hidden" name="email" value="<%=empleado.getEmail()%>"id="email"/>
                            <%=empleado.getEmail()%>
                        </td>

                        <td align="center" >
                            <input type="hidden" name="admissionDate" value="<%=empleado.getAdmissionDate()%>"id="admissionDate"/>
                            <%=empleado.getAdmissionDate()%>
                        </td>

                        <td align="center" >
                            <input type="hidden" name="dependentEcnomic" value="<%=empleado.getDependentEconomic()%>"id="dependentEcnomic"/>
                            <%=empleado.getDependentEconomic()%>
                        </td>
                        <td align="center" >
                            <input type="hidden" name="workedTipe" value="<%=empleado.getWorkedTipe()%>"id="workedTipe"/>
                            <%=empleado.getWorkedTipe()%>
                        </td>

                        <td align="center" >
                            <input type="hidden" name="maritalStatus" value="<%=empleado.getMaritalStatus()%>"id="maritalStatus"/>
                            <%=empleado.getMaritalStatus()%>
                        </td>
                        <td align="center" >
                            <input type="hidden" name="studies" value="<%=empleado.getStudies()%>"id="studies"/>
                            <%=empleado.getStudies()%>
                        </td>
                        
                        <td>
                        
                        <a href="javascript:ModificarUsuario(<%=empleado%>);" ><img src="<%=ContextPath%>/Img/actualizar.png"  width="21" height="21" alt="Modificar" style=" border: none; " /></a>
                    </td>
                    <td >
                        <!-- input type="hidden" value="< %=unUsuario.getEstatus()%>" name="Estado_< %=ini%>" id="Estado_< %=ini%>" / -->
                        <a href="<%=ContextPath%>/EmployConsult?tipoOperacion=4&IdEmploy=<%=empleado.getIdEmploy() %>"><img src="<%=ContextPath%>/Img/eliminar1.png" width="21" height="21" alt="eliminar" style=" border: none; " /></a> 
                    </td>
                    </tr>
            </table>
            </fieldset>
            <%}%>
        </form>

    </body>



<%@include file="../foot/JspFoodMainMenu.jsp"%>
</html>


